<template>
  <ant-modal
    modalWidth="576"
    modalHeight="500"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model ref="form" :model="form" :rules="rules" slot="content" layout="vertical">
      <a-row :gutter="32">
        <a-col :span="12" >
          <a-form-model-item label="供应商类别" prop="supplierCategory">
            <a-select
              placeholder="请选择供应商类别"
              v-model="form.supplierCategory"
              :getPopupContainer="
                triggerNode => {
                  return triggerNode.parentNode || document.body
                }
              "
              style="width: 100%"
              allow-clear>
              <a-select-option v-for="(d, index) in supplierCategoryOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="供应商编码" prop="supplierCode">
            <a-input v-model="form.supplierCode" placeholder="供应商编码自动生成" disabled='true'/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="供应商名称" prop="supplierName">
            <a-input v-model="form.supplierName" placeholder="请输入供应商名称"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="助记码" >
            <a-input v-model="form.mnemonicCode" placeholder="请输入助记码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="联系电话" prop="phone">
            <a-input v-model="form.phone" placeholder="请输入联系电话"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="联系人" prop="contactPerson">
            <a-input v-model="form.contactPerson" placeholder="请输入联系人"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="24">
          <a-form-model-item label="描述" prop="remark">
            <a-textarea v-model="form.remark" placeholder="请输入描述" :rows="4"/>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button :disabled="disabled" @click="cancel">
        取消
      </a-button>
      <a-button type="primary" :disabled="disabled" @click="submitForm(true)">
        保存
      </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizSupplierAddForm from './BizSupplierForm'
export default {
  ...BizSupplierAddForm
}
</script>
